package com.meixiang.entity.shopping;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

/**
 * 商品套装详细信息
 *
 * @author LZRUI
 */
public class GoodsGroupDetailEntity implements Parcelable {

    private String goodsId; // 组合商品id
    private String goodsName; // 组合商品名称
    private String goodsStorePrice;// 商品店铺价格
    private String goodsMarketPrice;// 商品市场价格
    private String benefit; // 优惠
    private List<GoodsSpecEntity> goodsSpecList; // 套装中的商品列表

    public GoodsGroupDetailEntity() {
    }

    public GoodsGroupDetailEntity(String goodsId, String goodsName, String goodsStorePrice, String goodsMarketPrice, String benefit, List<GoodsSpecEntity> goodsSpecList) {
        this.goodsId = goodsId;
        this.goodsName = goodsName;
        this.goodsStorePrice = goodsStorePrice;
        this.goodsMarketPrice = goodsMarketPrice;
        this.benefit = benefit;
        this.goodsSpecList = goodsSpecList;
    }

    public String getGoodsId() {
        return goodsId == null ? "" : goodsId;
    }

    public void setGoodsId(String goodsId) {
        this.goodsId = goodsId;
    }

    public String getGoodsName() {
        return goodsName == null ? "" : goodsName;
    }

    public void setGoodsName(String goodsName) {
        this.goodsName = goodsName;
    }

    public String getGoodsStorePrice() {
        return goodsStorePrice == null ? "0.00" : goodsStorePrice;
    }

    public void setGoodsStorePrice(String goodsStorePrice) {
        this.goodsStorePrice = goodsStorePrice;
    }

    public String getGoodsMarketPrice() {
        return goodsMarketPrice == null ? "0.00" : goodsMarketPrice;
    }

    public void setGoodsMarketPrice(String goodsMarketPrice) {
        this.goodsMarketPrice = goodsMarketPrice;
    }

    public List<GoodsSpecEntity> getGoodsSpecList() {
        return goodsSpecList;
    }

    public void setGoodsSpecList(List<GoodsSpecEntity> goodsSpecList) {
        this.goodsSpecList = goodsSpecList;
    }

    public String getBenefit() {
        return benefit == null ? "0.00" : benefit;
    }

    public void setBenefit(String benefit) {
        this.benefit = benefit;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.goodsId);
        dest.writeString(this.goodsName);
        dest.writeString(this.goodsStorePrice);
        dest.writeString(this.goodsMarketPrice);
        dest.writeString(this.benefit);
        dest.writeTypedList(this.goodsSpecList);
    }

    protected GoodsGroupDetailEntity(Parcel in) {
        this.goodsId = in.readString();
        this.goodsName = in.readString();
        this.goodsStorePrice = in.readString();
        this.goodsMarketPrice = in.readString();
        this.benefit = in.readString();
        this.goodsSpecList = in.createTypedArrayList(GoodsSpecEntity.CREATOR);
    }

    public static final Creator<GoodsGroupDetailEntity> CREATOR = new Creator<GoodsGroupDetailEntity>() {
        @Override
        public GoodsGroupDetailEntity createFromParcel(Parcel source) {
            return new GoodsGroupDetailEntity(source);
        }

        @Override
        public GoodsGroupDetailEntity[] newArray(int size) {
            return new GoodsGroupDetailEntity[size];
        }
    };
}
